
import {getToken,setToken,removeToken} from '../../utils/auth'

//本地缓存角色信息
let perInfo;
if (localStorage.getItem("perInfo")) {
  perInfo = JSON.parse(localStorage.getItem("perInfo"));
} else {
  perInfo = null
};

const user = {
  state: {
    token: getToken(),
    name: perInfo !== null ? perInfo.user.nickName : "",
    roles: perInfo !== null ? perInfo.roles : [],
    permissions: perInfo !== null ? perInfo.permissions : []
  },
  mutations: {

  },

  actions: {

  }
}

export default user
